package com.example.demo.controller;

import com.example.demo.model.Student;
import com.example.demo.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/getNameList")
    public List<Student> getNameList(@RequestParam String name){
        List<Student> ret;
        if(!StringUtils.hasLength(name)){
            log.warn("");
        }

        return userService.getStudentList(name);
    }
}
